<?php

class PreorderTraversal implements TreeTraversable 
{
    function traverseTree(BinaryTreeNode $node) 
    {
		$this->_data[] = $node->getValue();
		
		if ($node->getLeft() != null){
			$this->traverseTree($node->getLeft());
		}
		
		if ($node->getRight() != null){
			$this->traverseTree($node->getRight());
		}    
		
		return $this->_data;	
    }
}
?>